package me.zhulu.executor;

import java.util.concurrent.Callable;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * Created with IntelliJ IDEA.
 * User: herosea
 * Date: 14-4-23
 * Time: 上午10:37
 * To change this template use File | Settings | File Templates.
 */
public class ExecutorTest {

    public static void main(String[] args){
        ExecutorService executorService = Executors.newCachedThreadPool();
        for (int i = 0; i < 100000; i++){
            executorService.submit(new Callable<Object>() {
                @Override
                public Object call() throws Exception {
                    System.out.println(Thread.currentThread().getId());
                    return null;  //To change body of implemented methods use File | Settings | File Templates.
                }
            });
        }
    }
}
